<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="referrer" content="never">
    <title></title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        body {
            width: 1280px;
            height: 720px;
        }
        #title{
            width: 1080px;
            margin: 40px auto;
            font-size: 40px;
            padding-bottom: 40px;
            border-bottom: 1px solid #999999;
        }
        #content{
            width: 1080px;
            margin: auto;
        }
        img{
            max-width: 1080px;
        }

    </style>
</head>
<body>
<div id="title"></div>
<div id="content"></div>
<script src="/weixin-article/js/yajax.js"></script>
<script src="/weixin-article/js/lazyload.js"></script>
<script>
    //截取传值参数
    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return (r[2]);
        return null;
    }

    var clickFunction = function (keyEvent) {
        keyEvent = keyEvent ? keyEvent : window.event;
        keyEvent.which = keyEvent.which ? keyEvent.which : keyEvent.keyCode;
        keycontrol(keyEvent);
    };
    //window.document.onkeypress = clickFunction;
    window.document.onkeydown = clickFunction;

    //按键操作
    function keycontrol(obj) {
        if (obj.which == 0x0026) {
            /* 上 */
        } else if (obj.which == 0x0028) {
            /* 下 */
        } else if (obj.which == 0x0025) {
            /* 左 */
        } else if (obj.which == 0x0027) {
            /* 右 */
        } else if (obj.which == 0x000D) {
            /* 确定 */
        } else if ((obj.which <= 0x0039 && obj.which >= 0x0030) || obj.which == 0x118 || obj.which == 280) {//数字键输入
        } else if (obj.which == 113 || obj.which == 0x0008) {// 返回
            //          obj.stopPropagation();
            //          obj.preventDefault();
            history.go(-1);
        }
    }

    new YAjax().request({
        url: '/api/weixin-article/' + GetQueryString('id'),
        method: 'GET',
        success: function (result) {
            document.getElementById('content').innerHTML = result.data.content;
            document.getElementById('title').innerHTML = result.data.title;
//            lazyload();
        },
        receiveType: 'JSON'

    });
</script>
</body>
</html>